<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>GoldTree 量化交易管理系统</title>
    <link href="https://cdn.jsdelivr.net/npm/antd@5.15.0/dist/antd.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
    <link rel="stylesheet" href="css/main.css">
</head>
<body>
    <div class="layout">
        <!-- 侧边栏 -->
        <div class="sidebar">
            <div class="sidebar-logo">
                <h1><i class="fas fa-tree"></i> GoldTree</h1>
                <p>量化交易管理系统</p>
            </div>
            <ul class="sidebar-menu">
                <li><a href="#" onclick="showPage('dashboard', this)" class="active">
                    <i class="fas fa-tachometer-alt"></i> 数据仪表板
                </a></li>
                <li><a href="#" onclick="showPage('stocks', this)">
                    <i class="fas fa-chart-line"></i> 股票管理
                </a></li>
                <li><a href="#" onclick="showPage('pools', this)">
                    <i class="fas fa-layer-group"></i> 股票池管理
                </a></li>
                <li><a href="#" onclick="showPage('tags', this)">
                    <i class="fas fa-tags"></i> 标签管理
                </a></li>
                <li><a href="#" onclick="showPage('strategies', this)">
                    <i class="fas fa-robot"></i> 策略管理
                </a></li>
                <li><a href="#" onclick="showPage('risk', this)">
                    <i class="fas fa-shield-alt"></i> 风险管理
                </a></li>
            </ul>
        </div>

        <!-- 主内容区 -->
        <div class="main-content">
            <!-- 页面头部 -->
            <div class="header">
                <h2 id="page-title">数据仪表板</h2>
                <div class="user-info">
                    <span>管理员</span>
                    <button class="btn btn-primary" onclick="logout()">
                        <i class="fas fa-sign-out-alt"></i> 退出
                    </button>
                </div>
            </div>

            <!-- 页面内容 -->
            <div class="content">
                <!-- 数据仪表板页面 -->
                <div id="dashboard" class="page active">
                    <div class="stats-grid">
                        <div class="stat-card">
                            <div class="stat-number" id="total-stocks">-</div>
                            <div class="stat-label">股票总数</div>
                        </div>
                        <div class="stat-card">
                            <div class="stat-number" id="total-pools">-</div>
                            <div class="stat-label">股票池数量</div>
                        </div>
                        <div class="stat-card">
                            <div class="stat-number" id="total-strategies">-</div>
                            <div class="stat-label">策略数量</div>
                        </div>
                        <div class="stat-card">
                            <div class="stat-number" id="active-strategies">-</div>
                            <div class="stat-label">活跃策略</div>
                        </div>
                    </div>

                    <div class="card">
                        <h3>系统概览</h3>
                        <p>欢迎使用GoldTree量化交易管理系统！</p>
                        <ul>
                            <li>系统状态：<span class="tag tag-success">正常运行</span></li>
                            <li>数据库：<span class="tag tag-success">连接正常</span></li>
                            <li>API服务：<span class="tag tag-success">服务正常</span></li>
                        </ul>
                    </div>
                </div>

                <!-- 其他页面内容 -->
                <div id="stocks" class="page">
                    <div class="toolbar">
                        <button class="btn btn-primary" onclick="openModal('stockModal')">
                            <i class="fas fa-plus"></i> 添加股票
                        </button>
                    </div>
                    <div id="stocks-content"></div>
                </div>

                <div id="pools" class="page">
                    <div class="toolbar">
                        <button class="btn btn-primary" onclick="openModal('poolModal')">
                            <i class="fas fa-plus"></i> 创建股票池
                        </button>
                    </div>
                    <div id="pools-content"></div>
                </div>

                <div id="tags" class="page">
                    <div class="toolbar">
                        <button class="btn btn-primary" onclick="openModal('tagModal')">
                            <i class="fas fa-plus"></i> 创建标签
                        </button>
                    </div>
                    <div id="tags-content"></div>
                </div>

                <div id="strategies" class="page">
                    <div class="toolbar">
                        <button class="btn btn-primary" onclick="openModal('strategyModal')">
                            <i class="fas fa-plus"></i> 创建策略
                        </button>
                    </div>
                    <div id="strategies-content"></div>
                </div>

                <div id="risk" class="page">
                    <div class="card">
                        <h3>风险控制设置</h3>
                        <form id="risk-form">
                            <div class="form-group">
                                <label>最大仓位比例 (%)</label>
                                <input type="number" class="form-control" value="95" min="1" max="100">
                            </div>
                            <div class="form-group">
                                <label>单只股票最大仓位 (%)</label>
                                <input type="number" class="form-control" value="20" min="1" max="50">
                            </div>
                            <div class="form-group">
                                <label>止损比例 (%)</label>
                                <input type="number" class="form-control" value="5" min="1" max="20">
                            </div>
                            <button type="button" class="btn btn-primary" onclick="saveRiskSettings()">
                                <i class="fas fa-save"></i> 保存设置
                            </button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 模态框容器 -->
    <div id="modals"></div>

    <script src="js/api.js"></script>
    <script src="js/main.js"></script>
</body>
</html>